﻿/*
 * MapyCzFeatureSet
 * 
 * initial implementation : 18.7.2011
 *
 * Copyright (c) Adam Sida, asida@centrum.cz.
 * All rights reserved.
 * 
 * for license see Petra.Gis.License.txt
 */
using System;
using System.Collections;
using System.Collections.Generic;
using Petra.Gis.DataServices;
using Petra.Gis.DataServices.Metadata;
using Petra.Gis.Geometry;
using Petra.Gis.Geometry.Support;
using Petra.Gis.ReferenceSystemServices;

namespace Petra.Gis.DataServices.MapyCz
{
  public partial class MapyCzFeatureSet : FeatureSetBase
  {


    private FeatureMetadata pripravMetadata(string nazevMapy, string titulek)
    {
      return new FeatureMetadata()
      {
        Name = nazevMapy,
        Title = titulek,
        Authority = "seznam.cz, all rights reserved",
        Abstract = "podrobné navigační mapy Evropy a České republiky",
        //Bounds = BoundingBox.Parse("")
        GeometryFieldsMetadata = new[]
         {
          new SpatialFieldMetadata()
          {
            Name = "Dlazdice",
            DomainType = DomainGeometryTypeEnum.Grid,
            Abstract = "dlazdice 256 x 256 pixelu",
            SRS = new ProjectedCoordinateSystem()
            {
              Metadata = new ReferenceSystemServices.Metadata()
              {
                Name = "UTM zone 33, North hemisphere, East",
                Authority = "EPSG",
                AuthorityCode = 32633,
                Abbreviation = "UTM33N"
              },
              Axes = new AxisList
              {
                // note for axis directions
                new Axis(){ Name = "X", Orientation = Axis.East},
                new Axis(){ Name = "Y", Orientation = Axis.North}
              },
              DefaultEnvelope = BoundingBox.Parse("3641212;1981739;5922736;8302847"),
              Unit = DistanceUnit.Meter,
              ProjectionDef = new ProjectionDefinition()
              {
                ClassName = "universal transverse mercator",
                Metadata = new ReferenceSystemServices.Metadata()
                {
                  Name = "universal transverse mercator",
                  Authority = "EPSG",
                  //AuthorityCode = 9802,
                  Abbreviation = "utm",
                },
                AngularParameterUnit = AngularUnit.Degrees,
                DistanceParameterUnit = DistanceUnit.Meter,
                Parameters = new TransformParameters()
                {
                  {"latitude_of_origin", 0.0},
                  {"central_meridian", 0.0},
                  {"false_easting", 500000.0},
                  {"false_northing", 0.0},
                  {"scale_factor", 1.0},
                }
              },
              // geographic coordinate system...
              GeographicCoordinateSystem = new GeographicCoordinateSystem()
              {
                Datum = HorizontalDatum.Wgs1984,
                Axes = new AxisList
                {
                  new Axis(){ Name = "E", Orientation = Axis.East},
                  new Axis(){ Name = "N", Orientation = Axis.North},
                },
                PrimeMeridian = PrimeMeridian.Greenwich,
                Metadata = new ReferenceSystemServices.Metadata()
                {
                  Name = "WGS84",
                  Authority = "EPSG",
                  AuthorityCode = 4326,
                },
                Unit = AngularUnit.Degrees
              }

            }
          }
         },

      };
    }



  }

}
